import request from "@/request/request";
import requestMock from "@/request/requestMock";
// 获取三级列表
export function getCatGoryList() {
    return request.get('/api/product/getBaseCategoryList')
}
export function getBannerList() {
    return requestMock.get('/banner/list')
}
export function getFloorList() {
    return requestMock.get('/floor/list')
}
// 获取搜索到的商品列表
export function getSearchList(searchParams) {
    return request.post('/api/list', searchParams)
}
// 获取商品详情页
export function getDetailList(skuId) {
    return request.get(`/api/item/${skuId}`)
}
// 向购物车添加
export function addCartSome(skuId, skuNum) {
    return request.post(`/api/cart/addToCart/${skuId}/${skuNum}`)
}
//  获取购物车列表
export function getshopCartList() {
    return request.get(`/api/cart/cartList`)

}
//购物车选中单个
export function changeChecked(skuID, isChecked) {
    return request.get(`/api/cart/checkCart/${skuID}/${isChecked}`)
}
//删除单个数据
export function deletCartOne(skuId) {
    return request.delete(`/api/cart/deleteCart/${skuId}`)
}
//全选
export function allChecked(isChecked, skuIdList) {
    return request.post(`/api/cart/batchCheckCart/${isChecked}`, skuIdList)
}
// 删除选中
export function deleteCheck(skuIdList) {
    return request.post(`/api/cart/batchDeleteCart`, skuIdList)
}
// 注册验证码
export function getPassport(phone) {
    return request.get(`/api/user/passport/sendCode/${phone}`)
}
// 注册用户
export function userRegister(userInfo) {
    return request.post(`/api/user/passport/register`, userInfo)
}
// 用户登录获取token
export function userLogin(userInfo) {
    return request.post(`/api/user/passport/login`, userInfo)
}
// 获取用户信息
export function getUserInfo() {
    return request.get(`/api/user/passport/auth/getUserInfo`)
}
// 退出登录
export function UserLoginOut() {
    return request.get(`/api/user/passport/logout`)
}
// 获取用户地址信息(mock)
export function getUseraddress() {
    return requestMock.get('/address/list')
}
// 获取交易页面信息
export function getTradeInfo() {
    return request.get('/api/order/auth/trade')
}
// 提交订单
export function submitOrder(tradeNo, goodsDatil) {
    return request.post(`/api/order/auth/submitOrder?tradeNo=${tradeNo}`, goodsDatil)
}
// 获取订单支付信息
export function careatNative(orderId) {
    return request.get(`/api/payment/weixin/createNative/${orderId}`)
}
// 判断支付状况
export function queryPayStatus(orderId) {
    return request.get(`/api/payment/weixin/queryPayStatus/${orderId}`)
}
// 判断支付状况
export function getOrderInfo(page, limit) {
    return request.get(`/api/order/auth/${page}/${limit}`)
}
